<include file="../Public/header" />
<div id="content" interface="favorite">
	<div id="user-weibo-list" data-title="{$datatitle}" date-selected="true" data-footer="none" data-rememberScroll="true">
        <header>
            <div id="header-buttons">
                <a href="javascript:history.go(-1);">
                    <div id="back" class="header-menu-link" data-back="false">
                    </div>
                </a>

                <div id="messageLink" class="header-menu-link"><a href="{:U('w3g/Index/msgbox')}"><i class="num"></i></a></div>
        <div id="menuLink" class="header-menu-link"></div>
            </div>
            <h1 class="hasback">
                {$datatitle}
            </h1>
        </header>
	<!-- 个人信息 -->
	<div id="i_info">
		<div id="i_info_top">
                <div class="i_info_img"><img width="100%" src="{:APPS_URL}/w3g/_static/img/sys/profile_img.png"></div>
                <div id="i_info_top_ava">
                    <!-- 头像 -->
                    <img src="{$profile['avatar_big']}" width="70" height="70" >
                </div>
                <div id="i_info_top_box">
                    <div id="i_info_top_name">
                        <!-- 帐号昵称 -->
                        {$profile['uname']}
                    </div>
                    <div id="i_info_top_signature">
                        <php>if($profile['uid']==$_SESSION['mid']){</php>
                        <!--<div id="iitsb">
                            {$profile['intro']}
                        </div>-->
                        <php>}</php>
                        <!-- <div id="i_info_sendmsg" class="i_info_button">发私信</div> -->
                        <php>if($profile['uid'] != $mid) { </php>
                            <eq name="sendmsg" value="1">
                            <div id="post-msg-to-uid" class="i_info_button i_info_msg pure-button pure-button-cc ts-listen" data-listen="weibo-tosendmsg" data-uname="{$profile['uname']}" data-uid="{$profile['uid']}">发私信</div>
                            </eq>
                            <php>if(!$profile['follow_state']['following']){</php>
                                <div id="i_info_follow" class="i_info_button pure-button pure-button-cc" linkto="{:U('w3g/Index/doFollow',array('from'=>'weibo','type'=>'follow','user_id'=>$profile['uid']))}">加关注</div>
                            <php>}else {</php>
                                <div id="i_info_follow" class="i_info_button i_info_followed pure-button pure-button-cc" linkto="{:U('w3g/Index/doFollow',array('from'=>'weibo','type'=>'unfollow','user_id'=>$profile['uid']))}">取消关注</div>
                            <php>}</php>
                        <php>}else{</php>
                            <!-- <a href="{:U('w3g/Index/msgbox')}" class="pure-button pure-button-cc">消息盒子</a> -->
                            <a href="{:U('w3g/Setting/base')}" class="pure-button pure-button-cc">编辑资料</a>
                            <a href="#new-weibo" class="pure-button pure-button-cc">发分享</a>
                        <php>}</php>
                    </div>
                </div>
            </div>
	</div>
	<!-- 个人信息结束 -->
        <php>if($isAllowed == 0){</php>
        <div class="no_authority">-_-。sorry！根据对方隐私设置，您无权查看TA的主页</div>
        <php>}else{</php>
		<php>
			if($profile['uid'] != $mid){
				$iicb='i_info_counts_box';
			}else{
				$iicb='i_info_counts_box_i';
			}
		</php>
		<div id="i_info_counts" act="favorite">
				<php>if($profile['uid']!=$_SESSION['mid']){</php>
                    <div id="i_info_counts_box_weibo" class="{$iicb}" onclick="javascript:window.open('{:U('w3g/Index/profile','uid='.$profile['uid'])}','_self')">
                        <div class="i_info_counts_title">详细</div>
                        <div class="i_info_counts_title">资料</div>
                    </div>
                <php>}</php>
                    <div id="i_info_counts_box_weibo" class="{$iicb}" onclick="javascript:window.open('{:U('w3g/Index/weibo','uid='.$profile['uid'])}','_self')">
                        <div class="i_info_counts_num">{$profile.count_info.feed_count}</div>
                        <div class="i_info_counts_title">分享</div>
                    </div>
                    <div id="i_info_counts_box_guanzhu" class="{$iicb}" uid="{$profile.uid}" onclick="javascript:window.open('{:U('w3g/Index/following','uid='.$profile['uid'])}','_self')">
                        <div class="i_info_counts_num">{$profile.count_info.following_count}</div>
                        <div class="i_info_counts_title">关注</div>
                    </div>
                    <div id="i_info_counts_box_fensi" class="{$iicb}" onclick="javascript:window.open('{:U('w3g/Index/followers','uid='.$profile['uid'])}','_self')">
                        <div class="i_info_counts_num">{$profile.count_info.follower_count}</div>
                        <div class="i_info_counts_title">粉丝</div>
                    </div>
                <php>if($profile['uid']==$_SESSION['mid']){</php>
                    <div id="i_info_counts_box_shoucang" class="{$iicb} highlight" onclick="javascript:window.open('{:U('w3g/Index/favorite')}','_self')">
                        <div class="i_info_counts_num">{$profile.count_info.favorite_count}</div>
                        <div class="i_info_counts_title">收藏</div>
                    </div>
                <php>}</php>
		</div>

	<!-- big!box -->
	<volist name="weibolist" id="feed">
                    <div id="weibo-detail-{$feed.feed_id}" class="microblog-item ts-listen" data-listen="weibo-detail-{$feed.feed_id}" data-id="{$feed.feed_id}">
                        <!-- header -->
                        <div class="media m-i-header">
                            <div class="pull-left m-i-h-avatar ts-listen" data-listen="weibo-userpage-{$feed.uid}">
                                <img class="media-object m-i-h-a-img" src="{$feed.avatar_small}"><php>if($feed['user_gicon']):</php><a href="javascript:;" title="{$feed['user_gicon']['user_group_name']}" class="group_icon_only"><img alt="{$feed['user_gicon']['user_group_name']}" src="{$feed['user_gicon']['user_group_icon_url']}" ></a><php>endif;</php>
                            </div>
                            <div class="media-body m-i-h-info ts-listen" data-listen="weibo-userpage-{$feed.uid}">
                                <div class="m-i-h-i-l-name">{$feed.uname}</div>
                                <div class="m-i-h-i-l-description">{$feed['publish_time']|FriendlyDate}&nbsp;&nbsp;{$feed.from}</div>
                            </div>
                            <div class="m-i-h-right"></div>
                        </div>
                        <!-- body -->
                        <div class="m-i-body">
                            <p class="m-i-b-p" id="m-i-b-p-{$feed.feed_id}">{$feed['content']}</p>
                        </div>
                    </div>
                            <php>
                                switch($feed['type']){
                                    case 'postimage':
                                        switch(count($feed['attach'])){
                                            case 1:
                                                $img_class='m-i-b-p-100';
                                                break;
                                            case 2:
                                                $img_class='m-i-b-p-50';
                                                break;
                                            case 4:
                                                $img_class='m-i-b-p-50';
                                                break;
                                            default:
                                                $img_class='m-i-b-p';
                                                break;
                                        }
                                        echo '<div class="'.$img_class.' ts-listen" data-listen="weibo-detial-'.$feed['feed_id'].'">';
                                        foreach($feed['attach'] as $k => $v){
                                            //dump($v);
                                            if((count($feed['attach']) == 4) || (count($feed['attach']) == 2)){
                                                echo '<img src="'.$v['attach_middle_box'].'" alt="" class="ts-listen" data-listen="weibo-pic-view" data-src="'.$v['attach_url'].'" data-index="'.$k.'"/>';
                                            }elseif(count($feed['attach']) == 1){
                                                echo '<img src="'.$v['attach_middle'].'" alt="" class="ts-listen" data-listen="weibo-pic-view" data-src="'.$v['attach_url'].'" data-index="'.$k.'"/>';
                                            } else {
                                                echo '<img src="'.$v['attach_small'].'" alt="" class="ts-listen" data-listen="weibo-pic-view" data-src="'.$v['attach_url'].'" data-index="'.$k.'"/>';
                                            }
                                        }
                                        echo '</div>';
                                        break;
                                    case 'repost':
                                        $more = '';
                                        if($attachCount > 1) {
                                            $more = '<span class="pic-more">'.$attachCount.'photos</span>';
                                        }
                                        if($feed['transpond_data']['attach'] > 0 && $feed['transpond_data']['type'] == 'postimage'){
                                            echo '<div id="repost-'.$feed[feed_id].'" class="m-i-b-p m-i-b-p-repost ts-listen" style="padding:0;" data-listen="weibo-detail-'.$feed['api_source']['feed_id'].'"><img class="m-i-b-r-p" style="height:100%;float:left;width:33.3333%;max-width:33.3333%;" src="'.$feed['transpond_data']['attach'][0]['attach_small'].'" /><div style="float:right;width: 63%;margin-left: 3.6666%;"><div class="m-i-h-i-l-name" style="font-size:14px;color:#7e7e7e">'.$feed['transpond_data']['uname'].' <span style="font-size:12px;color:#9a9a9a">'.FriendlyDate($feed['transpond_data']['publish_time']).'</span></div><p style="margin:0;font-size:1em;color:#9a9a9a;padding-right:5px;overflow:hidden; height:66px;line-height:22px;">'.getShort($feed['transpond_data']['content'],40).'</p></div></div>';
                                        } elseif($feed['transpond_data']['attach'] > 0 && $feed['transpond_data']['type'] == 'postfile') {
                                            echo '<div id="repost-'.$feed[feed_id].'" style="display:block;background:none;padding:0" class="m-i-b-p m-i-b-p-repost ts-listen" data-listen="weibo-detail-'.$feed['api_source']['feed_id'].'">';
                                            for($i=0;$i<count($feed['api_source']['attach']);$i++){
                                        </php>
                                                <a href="{:U('widget/Upload/down', array('attach_id'=>$feed['api_source']['attach'][$i]['attach_id']))}" target="_blank" class="downloadbox">
                                                    <div class="pure-g">
                                                        <div class="d-name pure-u-3-4">
                                                            {$feed['transpond_data']['attach'][$i]['attach_name']}
                                                            <span>{$feed['transpond_data']['attach'][$i]['size']}</span>
                                                        </div>
                                                        <div class="pure-u-1-4">
                                                            <span class="fa fa-download"></span>
                                                        </div>
                                                    </div>
                                                </a>
                                            <php> }
                                            echo   '</div>';
                                        } else {
                                            echo '<div id="repost-'.$feed[feed_id].'" class="m-i-b-p m-i-b-p-repost ts-listen" style="display:block" data-listen="weibo-detail-'.$feed['api_source']['feed_id'].'"><span>'.$feed['transpond_data']['uname'].'</span>: '.$feed['transpond_data']['content'].'</div>';
                                        }
                                        break;
                                    case 'repost-postimage':
                                        echo '<div id="repost-'.$feed[feed_id].'" class="m-i-b-p m-i-b-p-repost ts-listen" style="padding:0;" data-listen="weibo-detail-'.$feed['api_source']['feed_id'].'"><img class="m-i-b-r-p" style="height:100%;float:left;width:33.3333%;max-width:33.3333%;" src="'.$feed['transpond_data']['attach'][0]['attach_small'].'" /><div style="float:right;width: 63%;margin-left: 3.6666%;"><div class="m-i-h-i-l-name" style="font-size:14px;color:#7e7e7e">'.$feed['transpond_data']['uname'].' <span style="font-size:12px;color:#9a9a9a">'.FriendlyDate($feed['transpond_data']['publish_time']).'</span></div><p style="margin:0;font-size:1em;color:#9a9a9a;padding-right:5px;overflow:hidden; height:66px;line-height:22px;">'.getShort($feed['transpond_data']['content'],50).'</p></div></div>';
                                        break;
                                    case 'repost-removed':
                                        echo '<div id="repost-'.$feed[feed_id].'" class="m-i-b-p  m-i-b-p-repost"><span class="ts-listen" data-listen="weibo-userpage-'.$feed['transpond_data']['uid'].'">'.$feed['transpond_data']['uname'].'</span>: 这条分享不幸被删除了...</div>';
                                        break;
                                    case 'weiba_repost':
                                    echo '<p id="repost-'.$feed[feed_id].'" class="m-i-b-p  m-i-b-p-repost">转载自<span class="ts-listen" data-listen="weibo-weibapage-'.$feed['api_source']['feed_id'].'">'.$feed['api_source']['weiba_name'].'</span><font class="ts-listen" data-listen="weibo-weibadetail-'.$feed['api_source']['source_id'].'">'.$feed['api_source']['title'].'</font><p>';
                                        break;
                                    case 'weiba_repost-removed':
                                        echo '<p id="repost-'.$feed[feed_id].'" class="m-i-b-p  m-i-b-p-repost">原帖子已删除<p>';
                                        break;
                                    case 'postfile':
                                        echo '<div style="padding:0 0.75em; margin:0 0 0.75em 3.25em">';
                                        for($i=0;$i<count($feed['attach']);$i++){
                                            //dump($feed['attach'][$i]);
                                            </php>
                                            <a href="{:U('widget/Upload/down', array('attach_id'=>$feed['attach'][$i]['attach_id']))}" target="_blank" class="downloadbox">
                                                <div class="pure-g">
                                                    <div class="d-name pure-u-3-4">
                                                        {$feed['attach'][$i]['attach_name']}
                                                        <span>{$feed['attach'][$i]['size']}</span>
                                                    </div>
                                                    <div class="pure-u-1-4">
                                                        <span class="fa fa-download"></span>
                                                    </div>
                                                </div>
                                            </a>
                                            <php>

                                        }
                                        echo '</div>';
                                        break;
                                    case 'repost-postfile':
                                        echo '<div style="padding:0 0.75em;">';
                                        for($i=0;$i<count($feed['api_source']['attach']);$i++){
                                        </php>
                                        <a href="{:U('widget/Upload/down', array('attach_id'=>$feed['api_source']['attach'][$i]['attach_id']))}" target="_blank" class="downloadbox">
                                            <div class="pure-g">
                                                <div class="d-name pure-u-3-4">
                                                    {$feed['transpond_data']['attach'][$i]['attach_name']}
                                                    <span>{$feed['transpond_data']['attach'][$i]['size']}</span>
                                                </div>
                                                <div class="pure-u-1-4">
                                                    <span class="fa fa-download"></span>
                                                </div>
                                            </div>
                                        </a>
                                        <php>
                                            //var_dump($feed['api_source']['attach'][$i]);
                                        }
                                        echo '</div>';
                                        break;
                                    case 'postvideo':
                                        if(preg_match("/(thinksns\.com)/i", $feed['flashvar'])){
                                            echo '<div class="m-i-b-p-video-box ts-listen" data-video="'.$feed['flashvar'].'" data-listen="weibo-video-view">';
                                            echo '<div class="playico fa fa-play"></div>';
                                            echo '<img src="'.$feed['flashimg'].'" alt="video" class="m-i-b-p-video-img"/>';
                                            echo '</div>';
                                        }
                                        break;
                                    case 'repost-postvideo':
                                        echo '<div id="repost-'.$feed[feed_id].'" class="m-i-b-p m-i-b-p-repost"><span>'.$feed['transpond_data']['uname'].'</span>: '.$feed['transpond_data']['content'];
                                            if(preg_match("/(thinksns\.com)/i", $feed['transpond_data']['flashvar'])){
                                            echo '<div class="m-i-b-p-video-box ts-listen" data-video="'.$feed['transpond_data']['flashvar'].'" data-listen="weibo-video-view">';
                                            echo '<div class="playico fa fa-play"></div>';
                                            echo '<img src="'.$feed['transpond_data']['flashimg'].'" alt="video" class="m-i-b-p-video-img"/>';
                                            echo '</div>';
                                            }
                                        echo '</div>';
                                        break;
                                    default:
                                        //dump($feed['type']);
                                        break;
                                }
                            </php>

                    <div id="m-i-footer-{$feed.feed_id}" class="m-i-footer">
                        <div class="pure-g" data-uname="{$feed.uname}" data-uid="{$feed.uid}">
                            <div class="pure-u-1-4 ts-textcenter ts-listen" data-listen="weibo-list2retweet-{$feed.feed_id}" data-share="1" data-origin="{$feed.cancomment}" data-repost="{$feed['repost']}">
                                <div class="weibo-item-btn weibo-item-btn-retweet"></div>
                                <span class="ts-number">{$feed['repost_count']}</span>
                            </div>
                            <div class="pure-u-1-4 ts-textcenter ts-listen" data-listen="weibo-list2reply-{$feed.feed_id}" data-share="1" data-origin="{$feed.cancomment}" data-curorigin="{$feed.cancomment_current}" data-repost="{$feed['repost']}">
                                <div class="weibo-item-btn weibo-item-btn-reply"></div>
                                <span class="ts-number">{$feed['comment_count']}</span>
                            </div>
                            <php>
                                if($feed['is_digg']==1){
                                    $purelight='pure-light';
                                }else{
                                    $purelight='';
                                }
                            </php>
                            <div class="pure-u-1-4 ts-textcenter ts-listen {$purelight}" data-listen="weibo-list2digg-{$feed.feed_id}" data-isdig="{$feed['is_digg']}">
                                <div class="weibo-item-btn weibo-item-btn-like"></div>
                                <span class="ts-number">{$feed['digg_count']}</span>
                            </div>
                            <php>
                                if($feed['favorited']==1){
                                $fa_star='fa-star';
                                $purelight='pure-light';
                                }else{
                                $fa_star='fa-star-o';
                                $purelight='';
                                }
                            </php>
                            <div class="pure-u-1-4 ts-textcenter ts-listen {$purelight}" data-listen="weibo-list2favorite-{$feed.feed_id}" data-isstar="{$feed['favorited']}" data-type="{$feed.app_row_table}">
                                <div class="weibo-item-btn weibo-item-btn-star"></div>
                            </div>
                        </div>
                    </div>
                </volist>
         <php>if($count>10){</php>
	<!-- 分页 -->
	<div id="pager_box">
		<php>if(empty($_GET['page']) || $_GET['page']==1){</php>
			<a href="javascript:;" link="" id="prev" class="pager_child pager_p_n_none pure-button pure-button-disabled">上一页</a>
		<php>}else{</php>
			<a href="{:U('w3g/Index/favorite',array('page'=>$page-1))}" id="prev" class="pager_child pager_p_n pure-button pure-button-primary">上一页</a>
		<php>}</php>
			<php>
				$_GET['page']!=0?$get=$_GET['page']:$get=1;
				$_count = ceil($count/10);
			</php>
		<php>if($get == $_count) {</php>
			<a href="javascript:;" link="" id="next" class="pager_child pager_p_n_none pure-button pure-button-disabled">下一页</a>
		<php>}else{</php>
			<a href="{:U('w3g/Index/favorite',array('page'=>$page+1))}" id="next" class="pager_child pager_p_n pure-button pure-button-primary">下一页</a>
		<php>}</php>
	</div>
        <php>}
        }</php>
	</div>
	<!-- bog!box end -->
	<!-- 列表结束################################################################################################ -->
	<include file="../Public/footer" />